<template>
<div>
    <Row type="flex" class="margin-top-10">
        <Col span="6">
        <Card style="height: 100%">
            <Row type="flex" class="margin-top-10" justify="center">
                <Col span="5">
                <P class="labelcss">会计期间：</P>
                </Col>
                <Col span="6">
                <Select v-model="acctyear">
                    <Option v-for="item in acctyears" :value="item.value" :key="item.value">{{ item.label }}</Option>
                </Select>
                </Col>
                <Col span="2">
                <P class="labelcss">年</p>
                </Col>
                <Col span="6">
                <Select v-model="acctperiod">
                    <Option v-for="item in acctperiods" :value="item.value" :key="item.value">{{ item.label }}</Option>
                </Select>
                </Col>
                <Col span="2">
                <P class="labelcss">期</p>
                </Col>
            </Row>
            <Row type="flex" class="margin-top-10" justify="center">
                <Col span="20">
                <Input v-model="modelInput" type="text" icon="search"></Input>
                </Col>
                <Col span="20">
                <Tree :data="org"></Tree>
                </Col>
            </Row>
        </Card>
        </Col>
        <Col span="18">
        <Card style="height: 100%">
            <Row type="flex" class="margin-top-10">
                <Col span="2">
                <P class="labelcss">业主方：</p>
                </Col>
                <Col span="3">
                <Select v-model="modelSelect">
          <Option v-for="item in selectItems" :value="item.value" :key="item.value">{{ item.label }}</Option>
        </Select>
                </Col>
                <Col span="2">
                <P class="labelcss">合同编号：</p>
                </Col>
                <Col span="3">
                <Input v-model="modelInput" type="text">
                </Input>
                </Col>
                <Col span="2">
                <P class="labelcss">项目名称：</p>
                </Col>
                <Col span="3">
                <Input v-model="modelInput" type="text">
                </Input>
                </Col>
                <Col span="5">
                
                </Col>
                <Col span="4" style="text-align:right">
                <Button type="ghost">查询</Button>
                <Button type="ghost">重置</Button>
                </Col>
            </Row>
            <Row type="flex" class="margin-top-10">
                <Col span="24">
                <Button type="ghost" @click="model1 = true">新建</Button>
                <Button type="ghost">批量录入</Button>
                <Button type="ghost">删除</Button>
                <Button type="ghost">列选</Button>
                <Button type="ghost">审核</Button>
                <Button type="ghost">销核</Button>
                <Button type="ghost">导出</Button>
                </Col>
            </Row>
            <Row type="flex" class="margin-top-10">
                <Col span="24">
                <Table border :columns="columns" :data="data"></Table>
                </Col>
            </Row>
            <Row type="flex" class="margin-top-10">
                <Col span="24" style="text-align:right">
                <Page show-elevator total="100"></Page>
                </Col>
            </Row>
        </Card>
        </Col>
        <Modal v-model="model1" title="存货台账" :mask-closable="false">           
            <AddPage></AddPage>
        </Modal>
    </Row>
</div>
</template>
<script>
import expandRow from './stockAccountListExpand.vue';
import AddPage from './add.vue';
export default {
    components: {
        expandRow,
        AddPage,
    },
    data() {
        return {
            model1: false,
            "acctyear": "",
            "acctperiod": "",
            "acctyears": [{
                "label": "2016",
                "value": "1"
            }, {
                "label": "2017",
                "value": "2"
            }, {
                "label": "2018",
                "value": "3"
            }],
            "modelInput": "",
            "acctperiods": [{
                "label": "1",
                "value": "1"
            }, {
                "label": "2",
                "value": "2"
            }, {
                "label": "3",
                "value": "3"
            }],
            org: [{
                title: '组织机构',
                expand: true,
                children: [{
                        title: '单位A',
                        expand: true,
                        children: [{
                                title: '单位A-1'
                            },
                            {
                                title: '单位A-2'
                            }
                        ]
                    },
                    {
                        title: '单位B',
                        expand: true,
                        children: [{
                                title: '单位B-1'
                            },
                            {
                                title: '单位B-2'
                            }
                        ]
                    }
                ]
            }],
            columns: [{
                    type: 'expand',
                    width: 50,
                    render: (h, params) => {
                        return h(expandRow, {
                            props: {
                                rows: params.row.detail
                            }
                        })
                    }
                },
                {
                    title: '项目名称',
                    key: 'name'
                },
                {
                    title: '合同号',
                    key: 'contractNo',
                    width: 150
                },
                {
                    title: '业主方',
                    key: 'a1'
                },
                {
                    title: '承建方',
                    key: 'a2'
                },
                {
                    title: '承建方已确认总收入',
                    key: 'a3'
                },
                {
                    title: '承建方已确认总成本',
                    key: 'a4'
                },
                {
                    title: '总可售面积',
                    key: 'a5'
                },
                {
                    title: '上期末累计销售比率',
                    key: 'a6'
                },
                {
                    title: '当期销售面积',
                    key: 'a7'
                },
                {
                    title: '累计销售面积',
                    key: 'a8'
                },
                {
                    title: '期末未销售比率',
                    key: 'a9'
                },
            ],
            data: [{
                    name: '长风项目',
                    contractNo: '20180425-01',
                    a1: '张先生',
                    a2: '中国建筑',
                    a3: '10000.00',
                    a4: '8000.00',
                    a5: '19600.00',
                    a6: '',
                    a7: '8820.00',
                    a8: '8820.00',
                    a9: '',
                    detail: [{
                            date: '2018-04-25',
                            area: '100'
                        },
                        {
                            date: '2018-04-25',
                            area: '100'
                        },
                    ],
                },
                {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                {
                    name: 'Joe Black',
                    age: 30,
                    address: 'Sydney No. 1 Lake Park',
                    job: 'Data Product Manager',
                    interest: 'tennis',
                    birthday: '1992-01-31',
                    book: 'Win',
                    movie: 'Jobs',
                    music: 'Don’t Cry'
                },
                {
                    name: 'Jon Snow',
                    age: 26,
                    address: 'Ottawa No. 2 Lake Park',
                    job: 'Data Analyst',
                    interest: 'snooker',
                    birthday: '1988-7-25',
                    book: 'A Dream in Red Mansions',
                    movie: 'A Chinese Ghost Story',
                    music: 'actor'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                 {
                    name: 'Jim Green',
                    age: 25,
                    address: 'London No. 1 Lake Park',
                    job: 'Data Scientist',
                    interest: 'volleyball',
                    birthday: '1989-03-18',
                    book: 'My Struggle',
                    movie: 'Roman Holiday',
                    music: 'My Heart Will Go On'
                },
                
            ]
        }
    }
}
</script>
<style>
@import '../../styles/common.less';
p {
    text-align: center;
    line-height: 30px;
}
</style>